This repository has been archived by the owner on Jan 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
Upgrade logging #113
Open
diogoaihara
wants to merge
15
commits into
main
Choose a base branch
from
logging
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Upgrade logging #113
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
diogoaihara
commented
Oct 18, 2022
- Create logging wrapper
- Remove logging handler
Sample Service Account file for GCP auth inside docker
* Fix BatchesFromExecutions: size estimation overflow + filter by destination type in process func * Explanation about estimate_size
Mr-Lopes
suggested changes
Oct 24, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see comments
summary_of_records = execution.summary_of_records | ||
msg = f"{execution_counter}. {key}:\n \ | ||
- Type: {str(execution.destination.destination_type)[16:]}\n \ | ||
- Total records: {summary_of_records['total']}\n \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
total_records is never set, making the total always equal to 0.
Mr-Lopes
suggested changes
Oct 24, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments.
@@ -132,14 +132,14 @@ def _do_upload_data( | |||
'conversions': conversions, | |||
} | |||
|
|||
logger.info(f'Conversions: \n{conversions}') | |||
logger.info(f'Conversions: \n{conversions}', execution=execution) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when executing in a container, the execution parameter throws an error:
"Traceback (most recent call last):
File "apache_beam/runners/common.py", line 1198, in apache_beam.runners.common.DoFnRunner.process
File "apache_beam/runners/common.py", line 537, in apache_beam.runners.common.SimpleInvoker.invoke_process
File "/app/megalista_dataflow/uploaders/utils.py", line 74, in inner
logger.info(f'Uploading {len(batch.elements)} rows...', execution=batch.execution)
File "/usr/local/lib/python3.9/logging/__init__.py", line 1446, in info
self._log(INFO, msg, args, **kwargs)
TypeError: _log() got an unexpected keyword argument 'execution'"
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.